#ifndef _COMMAND_HANDLER_H
#define _COMMAND_HANDLER_H

typedef enum {
    READ_PROGRAM_LAYER = 0x02
} ProgramLayerCmd;

typedef enum {
    READ_PROGRAM_LAYER_BACK = 0xF2
} ProgramLayerCmd_Back;

typedef enum {
    READ_VER_INFO = 0x04,
    SET_MODE = 0x05,
    ERASE_FLASH = 0x06,
    PROGRAM_FLASH = 0x07,
    CHECK_CRC = 0x08
} UpgradeCmd;   //rec

typedef enum {
    READ_VER_INFO_BACK = 0xF4,
    SET_MODE_BACK = 0xF5,
    ERASE_FLASH_BACK = 0xF6,
    PROGRAM_FLASH_BACK = 0xF7,
    CHECK_CRC_BACK = 0xF8
} UpgradeCmd_Back;  //rep

typedef enum {
    READ_VER_INFO_SPI = 0xC1,
    SET_MODE_SPI = 0x42,
    ERASE_FLASH_SPI = 0x43,
    PROGRAM_FLASH_SPI = 0x44,
    CHECK_CRC_SPI = 0x45,
} UpgradeCmd_Spi;

typedef enum {
    READ_VER_INFO_UART = 0x01,
    SET_MODE_UART = 0x02,
    ERASE_FLASH_UART = 0x03,
    PROGRAM_FLASH_UART = 0x04,
    CHECK_CRC_UART = 0x05,
} UpgradeCmd_Uart;

typedef enum {
    READ_VER_INFO_UART_BACK = 0x41,
    SET_MODE_UART_BACK = 0x42,
    ERASE_FLASH_UART_BACK = 0xC3,
    PROGRAM_FLASH_UART_BACK = 0xC4,
    CHECK_CRC_UART_BACK = 0xC5,
} UpgradeCmd_Uart_Back;

void CommandHandler_Execute(void);

void PopulateRplyPack(void);
void HandlePanelCommCommand(void);
#define  DELAY_2MS_VALUE       (2)
#define  DELAY_3MS_VALUE       (3)
#define  DELAY_5MS_VALUE       (5)
#define  DELAY_200MS_VALUE     (200) 
#define  DELAY_1000MS_VALUE    (1000)
#define  DELAY_2000MS_VALUE    (2000)

#endif